<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>捕获器不变式</title>
</head>
<body>
  <script>
    const target = {};
    Object.defineProperty(target, 'foo', {
      configurable: false,
      writable: false,
      value: 'bar'
    });

    const proxy = new Proxy(target, {
      get() {
        return 'qux';
      }
    });

    console.log(proxy.foo);  // TypeError
  </script>
</body>
</html>